<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class SchoolRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        $rule = [
//            'name' => 'required|string|min:1',
            'name' => 'required|string|min:1|unique:schools',
//            'password' => 'required|string|min:6|required',
//            'phone' => 'required|string|min:11|required',
        ];
        return $rule;
    }
    public function messages()
    {
        return [
           // 'unique'=>':attribute 手机号码已经存在',
           // 'required'=>':attribute 为必填项',
           // 'min'=>':attribute 长度最少 :min ,不符合要求',
            'name.unique'=>"学校不能重复",
        ];

    }
}
